home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / xw2.000 / xw2 / xw / samples / BASIC-PRINCIPLES / two-formats.xwx < prev   
Encoding:
Text File  |  1994-12-11  |  1009 b   |  30 lines

  1. % This sample shows how to
  2. % - edit the same floating point number with 2 different formats:
  3. %   a) in [1/10N] (object TEST01)
  4. %   b) 1:1, no conversion (object TEST02)
  5. % - the function of the "ff" (float-format) command:
  6. %   ff( ("%12.7f") ("[1/10N]") 10 ); generates the output of the
  7. %   VAR-PARAMETER in the following way:
  8. %   sprintf(VAR-PARAMETERstring,"%12.7f [1/10N]",number/10);
  9.  
  10. Malloc(90); @xbwstart( ("t") ("bw") ); wdw(TEST 1 1 25 9 StandardWDW);
  11.  
  12. o(TEST01 D D  1 3 23 1 Standard);       % First Float Object
  13. bg(TEST01 . 123.45 );                   % VAR-PARAMETER is 1234
  14.   ff( ("%12.7f") ("[1/1.3]") 1.3 );     % SCALE 1/1.3
  15.   eg();
  16.  
  17. o(TEST02 D D  1 5 23 1 Standard);       % Second Float Object
  18. bg(TEST02 . (ptr)OBJ:TEST01.V);   %<--- Pointer to VAR-PARAMETER above!
  19.   ff( ("%12.7f") ("[1]") 1 );           % SCALE 1:1
  20.   eg();
  21.  
  22. o(TEST03  S S 14 7 10 1 Secure 1 1 0 ); % EXIT Button
  23. bg(TEST03 . ("Stop XbW") );
  24.   cn(rqK ("@xbwstop();") );
  25.   eg();
  26.  
  27. Message( ("Project Complete.") );
  28. End();
  29.  
  30.